package com.cloudkinto.service.order.shelf;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.api.InboundReceiptAndShelfApiBo;
import com.cloudkinto.bo.order.shelf.*;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderInputDo;
import com.cloudkinto.entity.OrderInputShelfDo;
import com.cloudkinto.vo.order.shelf.*;
import com.cloudkinto.vo.wr.cost.OrderInputCostReq;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 入库产品上架表（中间表） service接口
 * </p>
 *
 * @author long
 * @since 2024-11-07
 */
public interface OrderInputShelfService extends IService<OrderInputShelfDo> {

    OrderInputShelfDetailVo detail(Long id, Long tenantId);

    SingleResult<Map<String, Object>> pageInit(Long userId, Long tenantId, String source);

    PageResult<OrderInputShelfListVo> getListPage(OrderInputShelfQueryBo bo);

    SingleResult<Map<String, Object>> shelfDetailInit(Long tenantId);

    ShelfDetailVo shelfDetail(ShelfDetailQueryBo bo);

    PageResult<ShelfBySkuVo> shelfBySkuListPage(ShelfBySkuQueryBo bo);

    PageResult<ShelfByBoxMarkNoVo> shelfByBoxMarkNoListPage(ShelfByBoxMarkNoQueryBo bo);

    PageResult<ShelfByBoxTypeNoVo> shelfByBoxTypeNoListPage(ShelfByBoxTypeNumberQueryBo bo);

    boolean shelfByBoxMarkNumber(ShelfByBoxMarkNumberAddBo bo, Long userId, String username);

    boolean shelfBySku(ShelfBySkuAddBo bo, Long userId, String username);

    boolean shelfByBoxTypeNo(ShelfByBoxTypeNumberAddBo bo, Long userId, String username);

    Integer partShelfOption(Long pasId);

    SingleResult<List<Map<String, Object>>> getListPageStatus(OrderInputShelfQueryBo bo);

    /**
     * 根据入库单对象构建入库计费实体
     *
     * @param orderInputDo 入库单
     * @param status       0实扣 1预扣
     * @return 入库单计算操作费bo
     */
    OrderInputCostReq buildInboundCostReq(OrderInputDo orderInputDo, Integer status);

    void shelfPrint(Long pasId, HttpServletResponse response) throws IOException;

    void wholeOrderReceiptAndShelf(InboundReceiptAndShelfApiBo bo, Long userId, String username);
}
